﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    <script src="/Scripts/jquery-1.8.2.min.js"></script>
    <link href="/Scripts/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/uploadify/jquery.uploadify-3.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            //图片上传
            $("#fuFileUploader").uploadify({
                buttonImage: null,       // We use a trick below to overlay a fake html upload button with this hidden flash button                         
                swf: '@Url.Content("~/Scripts/uploadify/uploadify.swf")',
                cancelImg: '@Url.Content("~/Scripts/uploadify/uploadify-cancel.png")',
                buttonText: '图片上传',
                uploader: '@Url.Action("FileUpload", "Upload")',
                buttonClass: 'btnUpload',
                multi: true,
                auto: true,
                fileTypeExts: '*.jpg;*.gif;*.png;*.jpeg',
                fileTypeDesc: 'Image Files',
                onUploadSuccess: function (file, data, response) {
                    if (data.Status == 'OK') {
                        //var server = data.baseURL;
                        //$("#image").attr("src", server + data.fileUrl);
                        //$("#ImgPath").val(data.fileUrl);
                        //$(".uploadify-queue-item").fadeOut(500, function () {
                        //});
                    }
                }

            });

        });
    </script>
</head>
    <body>
        <div>
            <table border="0">
                    <tr>
                        <td>
                            <div id="showImage">
                                <img src=''  style="height:120px; width:200px;" alt="" id="image" />
                            </div>
                        </td>
                        <td style="vertical-align: bottom;">
                            <div style="width: 220px;margin-left:10px; display: block">
                                <input id="fuFileUploader" name="file_upload" />
                            </div>
                        </td>
                    </tr>
                </table>
        </div>
</body>
</html>
